package com.xuedakun.xasdk;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.xuedakun.xasdk.net.volley.VolleyRequest;

/**
 * Created by xuedakun on 2017/6/3 14:50
 * 自定义的activity基类，打印了生命周期信息
 *
 * @version : v1.0
 * @project : xasdk
 * @Email : dakun611@Gmail.com
 */

public class XActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        XLog.i(getClass().getSimpleName(), "-------onCreate-------");
    }

    @Override
    protected void onStart() {
        super.onStart();
        XLog.i(getClass().getSimpleName(), "-------onStart-------");
    }

    @Override
    protected void onResume() {
        super.onResume();
        XLog.i(getClass().getSimpleName(), "-------onResume-------");
    }

    @Override
    protected void onPause() {
        super.onPause();
        XLog.i(getClass().getSimpleName(), "-------onPause-------");
    }

    @Override
    protected void onStop() {
        super.onStop();
        XLog.i(getClass().getSimpleName(), "-------onStop-------");
        //清空绑定此activity的全部请求
        VolleyRequest.getInstance().cancelRequest(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        XLog.i(getClass().getSimpleName(), "-------onDestroy-------");
    }
}
